package com.zllkj.mm.module;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import com.zllkj.mm.AppManager;
import com.zllkj.mm.base.BaseFragment;
import com.zllkj.mm.base.CommonActivity;
import com.zllkj.mm.module.general.activities.LoginActivity;
import com.zllkj.mm.module.main.MainActivity;
import com.zllkj.mm.util.EmptyUtils;


public class UIHelper {

    /**
     * 进入主界面
     */
    public static void showMainPage(Activity activity) {
        Intent mainIntent = new Intent(activity, MainActivity.class);
        AppManager.getAppManager().removeActivity(activity);
        AppManager.getAppManager().finishAllActivity();
        activity.startActivity(mainIntent);
        activity.finish();
    }

    public static void showLoginPage(Activity activity) {
        Intent mainIntent = new Intent(activity, LoginActivity.class);
        AppManager.getAppManager().removeActivity(activity);
        AppManager.getAppManager().finishAllActivity();
        activity.startActivity(mainIntent);
        activity.finish();
    }

    public static void showLoginPage_notClean(Activity activity) {
        Intent mainIntent = new Intent(activity, LoginActivity.class);
//        AppManager.getAppManager().removeActivity(activity);
//        AppManager.getAppManager().finishAllActivity();
        activity.startActivity(mainIntent);
//        activity.finish();
    }

    public static void showPage(BaseFragment baseFragment) {
        Intent intent = CommonActivity.newIntent(baseFragment);
        AppManager.getAppManager().currentActivity().startActivity(intent);
    }


}
